<!-- header-->
<head th:fragment=header(title)>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title th:text="${title}"></title>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->
    <link th:href="@{/favicon.ico}" rel="stylesheet"/>
    <link th:href="@{/fly/layui/css/layui.css}" rel="stylesheet"/>
    <link th:href="@{/fly/css/global.css}" rel="stylesheet"/>
</head>
<!-- 顶部-->
<div class="fly-header layui-bg-black" th:fragment="top">
  <div class="layui-container">
    <a class="fly-logo" href="/">
      <img th:src="@{/fly/images/logo.png}" alt="dev开发者社区">
    </a>

    <ul class="layui-nav fly-nav-user" th:switch="${session.currentUser!=null}" th:object="${session.currentUser}">
	 <th:block th:case="false">
      <!-- 未登入的状态 -->
      <li class="layui-nav-item">
        <a class="iconfont icon-touxiang layui-hide-xs" href="user/login.html"></a>
      </li>
      <li class="layui-nav-item">
        <a href="/login">登入</a>
      </li>
      <li class="layui-nav-item">
        <a href="/register">注册</a>
      </li>
      <li class="layui-nav-item layui-hide-xs">
        <a href="/app/qq/" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})" title="QQ登入" class="iconfont icon-qq"></a>
      </li>
      <li class="layui-nav-item layui-hide-xs">
        <a href="/app/weibo/" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})" title="微博登入" class="iconfont icon-weibo"></a>
      </li>
	</th:block>
      <!-- 登入后的状态 -->
     <th:block th:case="true">
      <li class="layui-nav-item">
        <a class="fly-nav-avatar" href="javascript:;">
          <cite class="layui-hide-xs">[[*{nickname}]]</cite>
          <i class="iconfont icon-renzheng layui-hide-xs" title="[[*{authContent}]]"></i>
          <i class="layui-badge fly-badge-vip layui-hide-xs">VIP3</i>
          <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg">
        </a>
        <dl class="layui-nav-child">
          <dd><a href="user/set.html"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
          <dd><a href="user/message.html"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a></dd>
          <dd><a href="user/home.html"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a></dd>
          <hr style="margin: 5px 0;">
          <dd><a href="/logout" style="text-align: center;">退出</a></dd>
        </dl>
      </li>
      </th:block>
    </ul>
  </div>
</div>


<div class="fly-panel fly-column" th:fragment="column(active)">
  <div class="layui-container">
    <ul class="layui-clear">
      <li th:class="${active=='index'}?'layui-hide-xs layui-this':''"><a href="/">首页</a></li>
      <li th:class="${active=='ask'}?'layui-hide-xs layui-this':''"><a href="/article/ask">提问</a></li>
      <li th:class="${active=='share'}?'layui-hide-xs layui-this':''"><a href="/article/share">分享<span class="layui-badge-dot"></span></a></li>
      <li th:class="${active=='discuss'}?'layui-hide-xs layui-this':''"><a href="/article/discuss">讨论</a></li>
      <li th:class="${active=='suggest'}?'layui-hide-xs layui-this':''"><a href="/article/suggest">建议</a></li>
      <li th:class="${active=='notice'}?'layui-hide-xs layui-this':''"><a href="/notice">公告</a></li>
<!--       <li th:class="${active=='news'}?'layui-hide-xs layui-this':''"><a href="/article/news">动态</a></li>  -->
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><span class="fly-mid"></span></li>

      <!-- 用户登入后显示 -->
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="user/index.html">我发表的贴</a></li>
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="user/index.html#collection">我收藏的贴</a></li>
    </ul>

    <div class="fly-column-right layui-hide-xs">
      <span class="fly-search"><i class="layui-icon"></i></span>
      <a href="/article/add" class="layui-btn">发表新帖</a>
    </div>
    <div class="layui-hide-sm layui-show-xs-block" style="margin-top: -10px; padding-bottom: 10px; text-align: center;">
      <a href="jie/add.html" class="layui-btn">发表新帖</a>
    </div>
  </div>
</div>

<div class="fly-footer" th:fragment="copyright">
  <p><a href="/" target="_blank">Dev开发者社区</a> [[${copyrightYear}]] &copy; </p>
<!--   <p>
    <a href="http://fly.layui.com/jie/3147/" target="_blank">付费计划</a>
    <a href="http://www.layui.com/template/fly/" target="_blank">获取Fly社区模版</a>
    <a href="http://fly.layui.com/jie/2461/" target="_blank">微信公众号</a>
  </p> -->
</div>

<!-- 底部 -->
<div th:fragment="footer(mods)">
	<div th:replace="include :: copyright"></div>
	<script th:src="@{/lib/jquery.min.js}"></script>
	<script th:src="@{/lib/template-web.js}"></script>
	<script th:src="@{/lib/template-helper.js}"></script>
	<script th:src="@{/fly/layui/layui.js}"></script>
	<script>
		layui.cache.page = '[[${mods}]]';
		layui.cache.user = {
		  username: '游客'
		  ,uid: -1
		  ,avatar: '/images/avatar/00.jpg'
		  ,experience: 83
		  ,sex: '男'
		};
		layui.config({
		  version: "3.0.0"
		  ,base: '/fly/mods/' //这里实际使用时，建议改成绝对路径
		}).extend({
		  fly: 'index'
		}).use('fly');
	</script>
</div>

<div th:fragment="user-nav">
	<ul class="layui-nav layui-nav-tree layui-inline">
	  <li class="layui-nav-item">
	    <a href="home.html">
	      <i class="layui-icon">&#xe609;</i>
	      我的主页
	    </a>
	  </li>
	  <li class="layui-nav-item layui-this">
	    <a href="index.html">
	      <i class="layui-icon">&#xe612;</i>
	      用户中心
	    </a>
	  </li>
	  <li class="layui-nav-item">
	    <a href="set.html">
	      <i class="layui-icon">&#xe620;</i>
	      基本设置
	    </a>
	  </li>
	  <li class="layui-nav-item">
	    <a href="message.html">
	      <i class="layui-icon">&#xe611;</i>
	      我的消息
	    </a>
	  </li>
	</ul>

	<div class="site-tree-mobile layui-hide">
	  <i class="layui-icon">&#xe602;</i>
	</div>
	<div class="site-mobile-shade"></div>

	<div class="site-tree-mobile layui-hide">
	  <i class="layui-icon">&#xe602;</i>
	</div>
	<div class="site-mobile-shade"></div>
</div>

<div class="fly-panel" th:fragment="ad">
	<div class="fly-panel-title">
  	这里可作为广告区域
	</div>
	<div class="fly-panel-main">
  		<a href="" target="_blank" class="fly-zanzhu" style="background-color: #393D49;">虚席以待</a>
  	</div>
 </div>

 <div class="fly-panel fly-link" th:fragment="friend-link">
  <h3 class="fly-panel-title">友情链接</h3>
  <dl class="fly-panel-main">
    <dd><a href="http://www.layui.com/" target="_blank">layui</a><dd>
    <dd><a href="http://layim.layui.com/" target="_blank">WebIM</a><dd>
    <dd><a href="http://layer.layui.com/" target="_blank">layer</a><dd>
    <dd><a href="http://www.layui.com/laydate/" target="_blank">layDate</a><dd>
    <dd><a href="mailto:xianxin@layui-inc.com?subject=%E7%94%B3%E8%AF%B7Fly%E7%A4%BE%E5%8C%BA%E5%8F%8B%E9%93%BE" class="fly-link">申请友链</a><dd>
  </dl>
</div>

<div th:fragment="adAndFriend">
	<div th:replace="include :: ad"></div>
	<div th:replace="include :: friend-link"></div>
</div>
